#!/usr/bin/env python
#
# Copyright 2009 Francois Cilliers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

"""
This module contains a couple of constant string declarations for site-specific
Friend Connect Javascript code (eg. gadget code).

If you want to copy code from experiments that use these constants, you can copy
your own Javascript code blocks into the items below. These Javascript code blocks
are generated at and copied from the Friend Connect Admin site at
http://www.google.com/friendconnect/admin/
"""


#################################################################################
# The code required to load Friend Connect JS API
# This was copied from the Javascript API tab in the "For developers" section of
# the Friend Connect Admin site at http://www.google.com/friendconnect/admin/
#################################################################################
LOADER="""
<!-- Load the Google AJAX API Loader -->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<!-- Load the Google Friend Connect javascript library. -->
<script type="text/javascript">
google.load('friendconnect', '0.8');
</script>

<!-- Initialize the Google Friend Connect OpenSocial API. -->
<script type="text/javascript">
google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);
google.friendconnect.container.initOpenSocialApi({
    site: '04271481058400343149',
    onload: function(securityToken) {
        /* your callback, which is passed a security token */
        /* called every time the user's identity becomes known or changes */
        initAllData();
    }
});
</script>
"""

#################################################################################
# The Ratings and reviews Gadget (Javascript)
# This was copied from the "Social Gadgets" section of
# the Friend Connect Admin site at http://www.google.com/friendconnect/admin/
#################################################################################
RATINGS_GADGET="""
<!-- Include the Google Friend Connect javascript library. -->
<!-- script type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></script -->
<!-- Define the div tag where the gadget will be inserted. -->
<div id="div-3299486331791531638" style="width:282px;border:1px solid #cccccc;"></div>
<!-- Render the gadget into a div. -->
<script type="text/javascript">
var skin = {};
skin['BORDER_COLOR'] = '#cccccc';
skin['ENDCAP_BG_COLOR'] = '#e0ecff';
skin['ENDCAP_TEXT_COLOR'] = '#333333';
skin['ENDCAP_LINK_COLOR'] = '#0000cc';
skin['ALTERNATE_BG_COLOR'] = '#ffffff';
skin['CONTENT_BG_COLOR'] = '#ffffff';
skin['CONTENT_LINK_COLOR'] = '#0000cc';
skin['CONTENT_TEXT_COLOR'] = '#333333';
skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
skin['CONTENT_HEADLINE_COLOR'] = '#333333';
skin['DEFAULT_COMMENT_TEXT'] = '- leave a comment here -';
skin['HEADER_TEXT'] = 'Ratings';
skin['POSTS_PER_PAGE'] = '5';
google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);
google.friendconnect.container.renderReviewGadget(
 { id: 'div-3299486331791531638',
   site: '04271481058400343149',
   'view-params':{"disableMinMax":"false","scope":"PAGE","allowAnonymousPost":"false","startMaximized":"true"}
 },
  skin);
</script>
"""

#################################################################################
# The Sample / Open Social demonstration Gadget (Javascript)
# This was copied from the "Social Gadgets" section of
# the Friend Connect Admin site at http://www.google.com/friendconnect/admin/
#################################################################################
SAMPLE_GADGET="""
<!-- Include the Google Friend Connect javascript library. -->
<!-- script type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></script -->
<!-- Define the div tag where the gadget will be inserted. -->
<div id="div-4310929718694536808" style="width:282px;border:1px solid #cccccc;"></div>
<!-- Render the gadget into a div. -->
<script type="text/javascript">
google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);
google.friendconnect.container.renderOpenSocialGadget(
 { id: 'div-4310929718694536808',
   url:'http://www.google.com/friendconnect/gadgets/sample.xml',
   site: '04271481058400343149' });
</script>
"""

